#include <bits/stdc++.h>

using namespace std;
const int M = 1010, N = 10;
int w[N] = { 0, 1, 2, 3, 5, 10, 20}; 
bool f[M];
int n = 6, m = 1000;
int x[N];
int main()
{
	for(int i = 1; i <= n; i++) cin >> x[i];
	
	f[0] = true;
	
	for(int i = 1; i <= n; i++)
		for(int j = m; j >= 0; j--)
			for(int k = 0; k <= x[i] && j >= k * w[i]; k++)
				f[j] = f[j] || f[j - k * w[i]];
				
	int ret = 0;
	for(int i = 1; i <= m; i++) 
		if(f[i]) ret++;
	cout << "Total=" << ret << endl;
	return 0;
} 
